import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '标识Id',
    dataIndex: 'dataTagId',
    width: 70,
  },
  {
    title: '标题',
    dataIndex: 'dataTagName',
    width: 130,
  },
  {
    title: '销售前缀',
    dataIndex: 'dataTagCode',
    width: 130,
  },
  {
    title: '企业编码',
    dataIndex: 'companyCode',
    width: 130,
  },
  {
    title: '是否本公司',
    dataIndex: 'isBenCompany',
    width: 120,
    dictData: [
      { label: '非本公司', value: 0, color: '#ee0303' },
      { label: '本公司', value: 1, color: '#032aee' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
    width: 80,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'dataTagId',
    label: '标识Id',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    field: 'dataTagName',
    label: '标识名称',
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '标识名称',
    field: 'dataTagName',
    component: 'Input',
    required: true,
  },
  {
    label: '销售前缀',
    field: 'dataTagCode',
    component: 'Input',
    required: false,
  },
  {
    label: '企业编码',
    field: 'companyCode',
    component: 'Input',
    required: true,
  },
  {
    label: '是否本公司',
    field: 'isBenCompany',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        { label: '非本公司', value: 0 },
        { label: '本公司', value: 1 },
      ],
    },
  },
];
